<template>
	<template v-if="item">
		<pre>Author: {{ item.author }}	Language: {{ item.languageName }}</pre>
		<pre><code>{{ item.content }}</code></pre>
	</template>
</template>

<script type="module">
import { PasteService } from '@/common/common.object';

export default {
	data() {
		return {
			item: {
				/*id: 1001,
				language: 1,
				languageName: "c",
				content: '#include <stdio.h>\n\nint main(){\n   printf("Hello, World!");\n   return 0;\n}',
				createTime: "2022-04-13 10:25:36",
				expireTime: "2022-04-13 10:28:59",

				author: "Test",*/
			}
		};
	},
	created() {
		PasteService.get(this.$route.params.id).then(result => {
			this.item = Object.freeze(result);
		});
	},
	mounted() {
		/* this.$nextTick(() => {
			setTimeout(() => {
				hljs.highlightAll();
				hljs.initLineNumbersOnLoad();
			}, 1000);
		}); */
	},
	methods: {
	}
}
</script>


<style>
pre {
	overflow: auto;
	display: block;
	padding: 9.5px;
	margin: 0 0 10px;
	font-size: 16px;
	line-height: 1.42857143;
	color: #333;
	word-break: break-all;
	word-wrap: break-word;
	background-color: #f5f5f5;
	border: 1px solid #ccc;
}

pre>code {
	padding: 0 !important;
}

.hljs-ln-line {
	padding: 0 8px 0 16px !important;
}
</style>
